﻿@model StatisticOnlinePeriodViewModel

@{
	ViewBag.Title = @Html.GetGlobalResource("PagesTitles", "AdminOnlinePeriod");
    Layout = "~/Views/Shared/_AdminLayout.cshtml";
}

<h2>@Html.GetGlobalResource("PagesTitles", "AdminOnlinePeriod")</h2>
@using (Html.BeginForm("OnlinePeriod", "Statistic", FormMethod.Post)) {
	<label>@Html.GetLocalResource("PeriodFrom") </label>
	@Html.TextBoxFor(x => x.StartDate)<label> @Html.GetLocalResource("PeriodTo") </label>
	@Html.TextBoxFor(x => x.EndDate)
	<br/>
	<label>@Html.GetLocalResource("TimeFrom") </label>
	@Html.TextBoxFor(x => x.StartTime)<label> @Html.GetLocalResource("TimeTo") </label>
	@Html.TextBoxFor(x => x.EndTime)
	<br/>
	<input type="submit" value="@Html.GetLocalResource("Apply")"/>
	<br/>
	<br/>
}
<table>
	<tr>
		<th>@Html.GetLocalResource("Category")</th>
		<th>@Html.GetLocalResource("Anonymous")</th>
		<th>@Html.GetLocalResource("Registered")</th>
	</tr>
	@foreach (var item in Model.Items) {
		<tr>
			<td>@item.Category.Title</td>
			<td>@item.Anonymous</td>
			<td>@item.Registered</td>
		</tr>
	}
	<tr>
		<td style="text-transform: uppercase;">@Html.GetLocalResource("Summary")</td>
		<td>@Model.Items.Sum(x => x.Anonymous)</td>
		<td>@Model.Items.Sum(x => x.Registered)</td>
	</tr>
</table>